<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

    class Commodity_model extends CI_Model
    {
	public function __construct()
	{
            parent::__construct();
	}

	function SelectCommodityCategory() 
	{
		$category = $this->db->query("CALL uspSelCommodityCategory()")->result_array();
		return $category;
		
	}
	
	function SelectCommodity($UserId, $CategoryId, $CommodityId, $CommodityTypeId)
	{
		$commodity = $this->db->query("CALL uspSelCommodity(".$UserId.",".$CategoryId.",".$CommodityId.",".$CommodityTypeId.")")->result_array();
		return $commodity;
	}
	
	function SelectCommodityName($CategoryId)
	{
		$commodity = $this->db->query("CALL uspSelCommodityName(".$CategoryId.")")->result_array();
		return $commodity;
	}
	
	function SelectCommodityType($CommodityId)
	{
		$commodity = $this->db->query("CALL uspSelCommodityType(".$CommodityId.")")->result_array();
		return $commodity;
	}
	
	function SelectUOM($uomId)
	{
		$uom = $this->db->query("CALL uspSelUOM(".$uomId.")")->result_array();
		return $uom;
	}
	
  }
?>
